#include<stdio.h>
#include<stdlib.h>
int main()
{
	int i, j;
	int x = 1, y = 7;
	int v_x = 1, v_y = 1;
	int top = 0, bottom = 25, left = 0, right = 50;
	while (1)
	{
		if (x < top || x> bottom)
			v_x = -v_x;
		x = x + v_x;
		if (y < left || y> right)
			v_y = -v_y;
		y = y + v_y;
		system("cls");
		for (i = 1; i < x; i++)
			printf("\n");
		for (j = 1; j < y; j++)
			printf(" ");
		printf("0\n");
	}
	system("pause");
	return 0;
}